#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.${parentArtifactId}.modules.sys.excel;
import ${package}.${parentArtifactId}.libcommon.excel.ExcelImporter;
import ${package}.${parentArtifactId}.modules.sys.service.SysOrgService;
import lombok.RequiredArgsConstructor;

import ${package}.${parentArtifactId}.modules.sys.dto.SysOrgDTO;
import java.util.List;

/**
 * SysOrg数据导入器
 */
@RequiredArgsConstructor
public class SysOrgImporter implements ExcelImporter<SysOrgDTO> {

    private final SysOrgService sysOrgService;
    private final Boolean isCovered;
    private final Long parentId;

    @Override
    public void save(List<SysOrgDTO> data) {
        if(parentId!=null){
            data.forEach(item->{
                item.setParentId(parentId);
            });
        }
        sysOrgService.importData(data, isCovered);
    }
}